package com.shanzmoo.db.sys.entity.dto;

import com.alibaba.fastjson.JSON;
import com.shanzmoo.db.sys.entity.RoleEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * 角色更新对象
 * @author Gzhao
 * @date 2020/11/16
 */
@Data
@ApiModel("角色更新对象")
public class RoleUpdateDto extends RoleSaveDto{

    @NotNull(message = "角色Id不允许为空")
    @ApiModelProperty("角色Id" )
    private Integer roleId;

    public static RoleEntity converted(RoleUpdateDto saveDto) {
        return JSON.parseObject(JSON.toJSONString(saveDto), RoleEntity.class);
    }
}
